package com.service;
import java.util.*;
import java.util.Map.Entry;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bean.Composition;
import com.dao.CompositionMapper;

public class RecipeCalculate {

public static Composition getAllNutrient(Map<String,Double> map,CompositionMapper compositionMapper){
	Composition com=new Composition();
	for(Entry<String, Double> entry:map.entrySet()){
		Composition temp=compositionMapper.get(entry.getKey());
		temp.multiply(entry.getValue());
		com.add(temp);
	}
		
	return com;
}
}
